package ute.mvc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ute.mvc.dao.QuestionDAO;
import ute.mvc.model.Question;
import ute.mvc.model.QuestionPool;
import ute.mvc.model.TestPart;

@Service ("questionService")
public class QuestionServiceImpl implements QuestionService{
	
	@Autowired
	QuestionDAO questionDAO;
	
	@Transactional
	public void addQuestion(Question question) {
		questionDAO.addQuestion(question);
	}
	@Transactional
	public void updateQuestion(Question question) {
		questionDAO.updateQuestion(question);
	}
	@Transactional
	public void deleteQuestion(Question question) {
		questionDAO.deleteQuestion(question);
	}
	public String getMaxIdInPool(QuestionPool pool) {
		// TODO Auto-generated method stub
		return questionDAO.getMaxIdInPool(pool);
	}
	public Question getQuestion(String questionID) {
		// TODO Auto-generated method stub
		return questionDAO.getQuestion(questionID);
	}
	public String getMaxIdInPart(TestPart part) {
		// TODO Auto-generated method stub
		return questionDAO.getMaxIdInPart(part);
	}
	public List<Question> getQuestionInPart(TestPart part) {
		// TODO Auto-generated method stub
		return questionDAO.getQuestionInPart(part);
	}

}
